/*  1:   */ package tt.dz.web.controller.user;
/*  2:   */ 
/*  3:   */ import com.alibaba.fastjson.JSON;
/*  4:   */ import java.util.ArrayList;
/*  5:   */ import java.util.List;
/*  6:   */ import javax.annotation.Resource;
/*  7:   */ import javax.servlet.http.HttpServletRequest;
/*  8:   */ import javax.servlet.http.HttpServletResponse;
/*  9:   */ import org.springframework.stereotype.Controller;
/* 10:   */ import org.springframework.web.bind.annotation.RequestMapping;
/* 11:   */ import org.springframework.web.bind.annotation.ResponseBody;
/* 12:   */ import tt.dz.biz.service.user.UserServiceService;
/* 13:   */ import tt.dz.common.LogUtil;
/* 14:   */ import tt.dz.vo.ResponseModle;
/* 15:   */ import tt.dz.vo.UserBaseVO;
/* 16:   */ import tt.dz.vo.UserServiceVO;
/* 17:   */ import tt.dz.web.controller.BaseController;
/* 18:   */ 
/* 19:   */ @Controller
/* 20:   */ public class UserServiceController
/* 21:   */   extends BaseController
/* 22:   */ {
/* 23:   */   @Resource(name="userServiceService")
/* 24:   */   private UserServiceService userServiceService;
/* 25:   */   
/* 26:   */   @RequestMapping(value={"/batchModifyUserService"}, produces={"application/json;charset=UTF-8"})
/* 27:   */   @ResponseBody
/* 28:   */   public String batchModifyUserService(HttpServletRequest request, HttpServletResponse response)
/* 29:   */   {
/* 30:34 */     boolean excuteFlag = false;
/* 31:   */     try
/* 32:   */     {
/* 33:36 */       List<UserServiceVO> userServiceList = JSON.parseArray(request.getParameter("userServiceList"), UserServiceVO.class);
/* 34:   */       
/* 35:38 */       String userId = request.getParameter("userId");
/* 36:39 */       excuteFlag = this.userServiceService.batchModifyUserService(userServiceList, userId);
/* 37:   */     }
/* 38:   */     catch (Exception e)
/* 39:   */     {
/* 40:41 */       LogUtil.error("批量更新用户可用服务异常", e);
/* 41:   */     }
/* 42:43 */     return JSON.toJSONString(assemblyResponseData(excuteFlag, null));
/* 43:   */   }
/* 44:   */   
/* 45:   */   @RequestMapping(value={"/queryUserServiceByUser"}, produces={"application/json;charset=UTF-8"})
/* 46:   */   @ResponseBody
/* 47:   */   public String queryUserServiceByUser(HttpServletRequest request)
/* 48:   */   {
/* 49:54 */     ResponseModle responseModle = null;
/* 50:   */     try
/* 51:   */     {
/* 52:56 */       UserBaseVO userBaseVO = (UserBaseVO)JSON.parseObject(request.getParameter("userBaseVO"), UserBaseVO.class);
/* 53:57 */       List<UserServiceVO> userServiceList = this.userServiceService.queryUserServiceByUser(userBaseVO);
/* 54:58 */       responseModle = new ResponseModle("success", userServiceList);
/* 55:   */     }
/* 56:   */     catch (Exception e)
/* 57:   */     {
/* 58:60 */       LogUtil.error("根据用户查询用户可用服务列表异常", e);
/* 59:61 */       responseModle = new ResponseModle("error", new ArrayList());
/* 60:   */     }
/* 61:63 */     return JSON.toJSONString(responseModle);
/* 62:   */   }
/* 63:   */ }


/* Location:           F:\work\pengyu\mainServer\WEB-INF\classes\
 * Qualified Name:     tt.dz.web.controller.user.UserServiceController
 * JD-Core Version:    0.7.0.1
 */